/*    */ package my.rummyInterface;
/*    */ 
/*    */ import java.awt.Color;
/*    */ import java.awt.Font;
/*    */ import java.awt.GridLayout;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import java.text.SimpleDateFormat;
/*    */ import java.util.Calendar;
/*    */ import javax.swing.BorderFactory;
/*    */ import javax.swing.JButton;
/*    */ import javax.swing.JPanel;
/*    */ import javax.swing.border.TitledBorder;
/*    */ 
/*    */ public class PanelGuardar extends JPanel
/*    */   implements ActionListener
/*    */ {
/*    */   private static final long serialVersionUID = 1L;
/* 26 */   public static String SALVAR = "SALVAR";
/*    */   public static final String DATE_FORMAT_NOW = "dd-MM-yyyy";
/*    */   private RummyInterface principal;
/*    */   private JButton btnSalvar;
/*    */ 
/*    */   public static String now()
/*    */   {
/* 30 */     Calendar cal = Calendar.getInstance();
/* 31 */     SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
/* 32 */     return sdf.format(cal.getTime());
/*    */   }
/*    */ 
/*    */   public PanelGuardar(RummyInterface principalP)
/*    */   {
/* 47 */     this.principal = principalP;
/*    */ 
/* 50 */     setLayout(new GridLayout(1, 1));
/*    */ 
/* 53 */     TitledBorder borde = BorderFactory.createTitledBorder("Guardar");
/* 54 */     borde.setTitleColor(Color.BLUE);
/* 55 */     borde.setTitleFont(new Font("Arial", 1, 12));
/* 56 */     borde.setBorder(BorderFactory.createEmptyBorder());
/* 57 */     setBorder(borde);
/*    */ 
/* 60 */     this.btnSalvar = new JButton("Salvar");
/* 61 */     this.btnSalvar.addActionListener(this);
/* 62 */     this.btnSalvar.setActionCommand(SALVAR);
/* 63 */     add(this.btnSalvar);
/*    */   }
/*    */ 
/*    */   public void actionPerformed(ActionEvent e)
/*    */   {
/* 69 */     String comando = e.getActionCommand();
/*    */ 
/* 71 */     if (comando.equals(SALVAR))
/*    */     {
/* 73 */       String app = now();
/* 74 */       this.principal.guardarJuego(app);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Yank\Documents\APO\Rummy\bin\
 * Qualified Name:     my.rummyInterface.PanelGuardar
 * JD-Core Version:    0.6.0
 */